var express = require('express');
var router = express.Router();

router.get('/', function(req, res) {
	defaultRouter(req, res)
});
router.get('/:userid', function(req, res) {
	userRouter(req, res)
});

module.exports = router;

function defaultRouter(req, res) {
	res.send('this is users.js');
}

function userRouter(req, res) {
	var result = 'hello ' + req.params.userid.toString();
	res.status(200).send(result);
}